<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="../static/css/prism.css" rel="stylesheet" />
</head>

<body>
    <h2>字符串可以用双引号或单引号包裹</h2>
    <pre><code class="language-javascript">'itbaizhan'
"itbaizhan"</code></pre>

    <h2>如果是长字符串，书写时的换行需要加上反斜杠\</h2>
    <pre><code class="language-javascript">var longString = 'Long \
long \
string';
longString
// "Long long long string"</code></pre>

    <script src="../static/js/prism.min.js"></script>

    <script>
        console.log("练习开始");
        console.log("测试反斜杠连接长字符串时，每行的字符串前不要用前导空格，否则也会被算进去");

        var a = 'This is a long long str.';
        var b = 'This \
is \
a \
long long str.';
        console.log(a);
        console.log(b);

        console.log("练习结束");
    </script>
</body>

</html>